from fastapi import APIRouter, Request
from app.parameter import QueryFilesParam, ReloadFileParam
from app.service import FileService
from app.utils import getUserInfo

router = APIRouter(tags=["群组路由"])
from utils import DEBUG


# 这个接口还没做完
@router.post("/file/reload")
async def create(reloadData: ReloadFileParam, request: Request):
    DEBUG(reloadData)
    userId = getUserInfo(request)
    return FileService.reloadFile(reloadData.fileId, reloadData.hubId, userId)

@router.post("/file/querys")
async def querys(queryFilesParam :QueryFilesParam,request: Request):
    userId = getUserInfo(request)
    return FileService.queryFiles(queryFilesParam, userId)


# @router.post("/hub/delete")
# async def delete(deleteHubParam: DeleteHubParam, request: Request):
#     DEBUG(deleteHubParam)
#     userId = getUserInfo(request)
#     return HubService.deleteHub(deleteHubParam, userId)

# @router.post("/hub/query")
# async def query(queryHubParam: QueryHubParam, request: Request):
#     DEBUG(queryHubParam)
#     userId = getUserInfo(request)
#     return HubService.queryHub(queryHubParam, userId)


